/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package views;

import java.io.BufferedWriter;
import java.io.OutputStreamWriter;
import java.net.Socket;

/**
 *
 * @author yulian
 */
public class SocketSend {
    private Socket socket;
    BufferedWriter salida;
    
    public SocketSend(String ip,int port,String message){
        try{
            socket=new Socket(ip,port);
            salida=new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
            salida.write(message);
            salida.flush();
            salida.close();
            socket.close();
        }catch(Exception e){
         e.printStackTrace();
        }
    }
}
